@include('Api.common.header')
<div class="layui-container">
<div class="layui-row">
    <div class="layui-col-lg12">
        <fieldset class="layui-elem-field">
            <legend>用户管理 - 新增规则</legend>
            <div class="layui-field-box">
                <form class="layui-form" action="{{ URL::action('Api\RuleController@save')}}">
                    <div class="layui-form-item">
                        <label class="layui-form-label">上级</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input layui-disabled" disabled value="{{$list['title']}}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">规则名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" lay-verify="required" autocomplete="off"
                                   placeholder="请输入规则名称" class="layui-input" lay-verType="tips">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">唯一标识</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" lay-verify="required" autocomplete="off"
                                   placeholder="请输入唯一标识" class="layui-input" lay-verType="tips">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">规则排序</label>
                        <div class="layui-input-inline">
                            <input type="text" name="sort" autocomplete="off" value="1" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">条件</label>
                        <div class="layui-input-block">
                            <textarea class="layui-textarea" rows="3" name="condition"></textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-block">
                            @foreach($status as $key => $vo)
                            <input type="radio" name="status" value="{{$key}}" title="{{$vo}}" @if($key == 1) checked @endif>
                            @endforeach
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" name="level" value="{{$list['level']}}">
                            <input type="hidden" name="parent_id" value="{{$list['id']}}">
                            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>
    </div>
</div>
</div>
<script type="text/javascript" src="/static/layui/layui.js"></script>
<script type="text/javascript" src="/static/backend/javascript/dw_form_submit.js"></script>
